home *** CD-ROM | disk | FTP | other *** search
- ASK
-
-
- Purpose: This command allows the user to set the BATCH
- environment ERRORLEVELS interactively.
-
- Format: ASK [prompt line]
-
- Type: Internal External
- ***
-
- Remarks: This command is designed to be used interactively.
- It allows the user some input into the BATCH
- environment. The 'prompt line' parameter is
- optional.
-
- Example: ASK Do you want to go to PAS2? (Y/N)
-
- This command accepts a single character from
- the user and sets ERRORLEVEL based on whether
- Y (or y) or N (or n) was entered.
-
- Y or y will set ERRORLEVEL to 0
- N or n will set ERRORLEVEL to 1
- Any other answer will cause "Y or N?" to echo
-
- ASK
-
- Displays 'Press Y or N ' on the console and
- waits for a keypress.
-
- (Sample BATCH file)
-
- ASK
- IF ERRORLEVEL 1 GOTO PRESSEDNO
- ECHO You pressed Y or y.
- GOTO end
- :PRESSEDNO
- ECHO You pressed N or n
- :end
-
- NOTES: ASK.COM accepts only Y, y, N, or n as a
- response in this version. (For more elaborate
- control, see INPUT.COM.)